package com.zsh.mybatis.dao;

import com.zsh.mybatis.bean.Employee;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;

/**
 * @author zsh
 * @Description
 * @create 2022-01-29 11:00
 */
public interface EmployeeMapper {

    //多条记录封装：Map<Integer,Employee> :key是这条记录的主键，值是封装后的JavaBean
    @MapKey("id")  //告诉mybatis封装这个map时，使用哪个属性作为map的key。
    Map<Integer,Employee> getEmployeeByLastNameLikeReturnMap(String lastName);

    //返回一条map，key列名，值一列值
    Map<String, Object> getEmployeeByIdReturnMap(Integer id);

    List<Employee> getEmployeeByLastNameLike(String lastName);

    Employee getEmployeeByMap(Map<String, Object> map);

    Employee getEmployeeByIdAndLastName(@Param("id")Integer id,@Param("lastName")String lastName);

    Employee getEmployeeById(Integer id);

    void addEmployee(Employee employee);

    void updateEmployee(Employee employee);

    void deleteEmployee(Integer id);
}
